compiler:remove unneccessary clone in final code gen #165
compiler:remove unneccessary clone in final code gen #165Timosdev99 wants to merge 1 commit intoleanEthereum:mainfrom
Conversation
|
Hi, thanks for the PR. Since the compilation performance is not currently an issue (and overall it's never a bottleneck since we need need to compile once, and then it does not impact the proving performance of the snarks), I would suggest we keep the compilation pipeline as simple as possible (even though it's already too much complex..), in particular Cloning is not an issue, and I think it's slightly simpler than |
Okay |
this pr unnecessary cloning of intermediate byte code blocks and per instruction cloning during final code gen. the compiler now moves byte code block by value and processes instruction by reference
intermediate_bytecode.bytecodeintocode_blocksinstead of cloningVec<IntermediateInstruction>compile_blockandcodegen_jumpto use burrowedIntermediateInstruction/IntermediateValuerather than clone each instructionthe previous implementation duplicate the entire intermediate program and cloned every instruction inside a hot loop, causing unnecessary heap allocation